package ProjetCorba;

/**
 * Interface definition : Casier
 * 
 * @author OpenORB Compiler
 */
public abstract class CasierPOA extends org.omg.PortableServer.Servant
        implements CasierOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Casier _this()
    {
        return CasierHelper.narrow(_this_object());
    }

    public Casier _this(org.omg.CORBA.ORB orb)
    {
        return CasierHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:ProjetCorba/Casier:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("estVide")) {
                return _invoke_estVide(_is, handler);
        } else if (opName.equals("getCasier")) {
                return _invoke_getCasier(_is, handler);
        } else if (opName.equals("getColis")) {
                return _invoke_getColis(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_estVide(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        boolean _arg_result = estVide();

        _output = handler.createReply();
        _output.write_boolean(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getCasier(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        ProjetCorba.Casier _arg_result = getCasier(arg0_in);

        _output = handler.createReply();
        ProjetCorba.CasierHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getColis(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        try
        {
            ProjetCorba.Colis _arg_result = getColis(arg0_in);

            _output = handler.createReply();
            ProjetCorba.ColisHelper.write(_output,_arg_result);

        }
        catch (ProjetCorba.Col_Inconnu _exception)
        {
            _output = handler.createExceptionReply();
            ProjetCorba.Col_InconnuHelper.write(_output,_exception);
        }
        return _output;
    }

}
